import {
  elFormItem,
  elFormplaceholder,
  AttrType,
  ComponentType,
  DragFormType,
  componentList,
  JSONType,
  compontent,
  hiddenAttrs,//隐藏属性 每个组件偶必须有如果引入elFormItem 就不需要了
} from "element-easy-form";
import { getcomponentName } from "../generate/DataPool/tool";
import { userTableFields } from "../generate/DataPool/mock";

const attrsJson: DragFormType[] = [
  {
    label: "类型",
    prop: "type",
    type: AttrType.COMPONENT,
    defaultValue: "text",

    componentName: ComponentType.ElSelect,
    attrs: {
      placeholder: "请选择类型",
      clearable: true,
    },
    rules: [{ required: true, message: "类型不能为空", trigger: "change" }],
  },
  ...elFormItem({
    label: "客户",
    prop: "customer",
  }),
  {
    type: AttrType.COMPONENT,
    label: "默认值",
    prop: "defaultValue",

    defaultValue: "",
    componentName: ComponentType.ElInput,
    attrs: {
      placeholder: "请输入",
    },
    rules: [{ required: false, message: "", trigger: "change" }],
  },
  elFormplaceholder("请输入"),
];
export const custom = [
  ...componentList,
  {
    title: "主表字段",
    attrs: {},
    prop: "container",
    
    type: AttrType.LAYOUT,
    children:getcomponentName(userTableFields)
    
    
  },
];
